package office.tool.scheduletask;

import java.util.Calendar;
import java.util.TimerTask;

import org.apache.log4j.Logger;

import office.service.sale.ICustomerService;
import platform.common.exception.BusinessException;
/**
 * 对客户表每月定时进行检查
 * @author ZhangYQ
 *
 */
public class SendCustomer  extends TimerTask {
	public Logger log = Logger.getLogger(this.getClass());
	private ICustomerService customerService;
	
	public void run() {
		try {
			int monthDate = 25;
				//Integer.parseInt(Util.parsePropertiesReturnStr("project", "monthDate"));
			Calendar calendar = Calendar.getInstance();
		    int day = calendar.get(Calendar.DAY_OF_MONTH);
		    if(monthDate==day){
		    	customerService.sendNote();
		    }
		} catch (BusinessException e) {
			log.error("", e);
		}
	}

	public ICustomerService getCustomerService() {
		return customerService;
	}

	public void setCustomerService(ICustomerService customerService) {
		this.customerService = customerService;
	}
	
}
